package com.panshi.controller;


import com.panshi.api.IAboutApi;
import com.panshi.service.ISearchService;
import com.panshi.service.ITypeService;
import com.panshi.vo.search.ArticleVo;
import com.panshi.vo.search.Paging;
import com.panshi.vo.search.SearchVo;
import com.panshi.vo.search.TypeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class AboutSysController implements IAboutApi {
    @Autowired
    ITypeService typeService;

    @GetMapping("/about/link")
    public List<TypeVo> link(){
        log.info("进来了++++++++++++link");
        return typeService.queryType();
    }

    @GetMapping("/about/me")
    public List<TypeVo> me(){
        log.info("进来了++++++++++++me");
        return typeService.queryType();
    }

    @GetMapping("/about/map")
    public List<TypeVo> map(){
        log.info("进来了++++++++++++map");
        return typeService.queryType();
    }

    @GetMapping("/about/leave")
    public List<TypeVo> leave(){
        log.info("进来了++++++++++++leave");
        return typeService.queryType();
    }

    @GetMapping("/about/zhaoping")
    public List<TypeVo> zhaoping(){
        log.info("进来了++++++++++++zhaoping");
        return typeService.queryType();
    }

    @GetMapping("/about/agree")
    public List<TypeVo> agree(){
        log.info("进来了++++++++++++agree");
        return typeService.queryType();
    }

    @GetMapping("/about/privacy")
    public List<TypeVo> privacy(){
        log.info("进来了++++++++++++privacy");

        return typeService.queryType();
    }


    @Autowired
    private ISearchService searchService;

    @RequestMapping("/search")
    public Paging<List<SearchVo>> search(@RequestBody Paging<String> pa){
        log.info("第二步进入AboutSysController......"+pa.toString());
        return searchService.search(pa);
    }

    @GetMapping("/findSou")
    public List<ArticleVo> findSou(){
        return searchService.findSou();
    }


}
